package co.fitstart.entity.courseware.dietary;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author dan
 *
 */
@Alias("dietaryProgramType")
public enum DietaryProgramType {
	
	BREAKFAST("breakfast", "早餐"),
	
	LUNCH("lunch", "午餐"),
	
	DINNER("dinner", "晚餐"),
	
	SNACK("snack", "加餐");
	
	private String alias;
	
	private String description;
	
	/**
	 * 
	 * @param alias
	 * @param description
	 */
	DietaryProgramType(String alias, String description) {
		this.alias = alias;
		this.description = description;
	}
	
	/**
     * 
     * @param alias
     * @return
     */
    public static DietaryProgramType aliasOf(String alias) {
        for (DietaryProgramType dietaryProgramType : DietaryProgramType.values()) {
            if (dietaryProgramType.getAlias().equalsIgnoreCase(alias)) {
                return dietaryProgramType;
            }
        }
        
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isBreakfast() {
        return this.equals(BREAKFAST);
    }
    
    /**
     * 
     * @return
     */
    public boolean isLunch() {
        return this.equals(LUNCH);
    }
    
    /**
     * 
     * @return
     */
    public boolean isDinner() {
        return this.equals(DINNER);
    }
    
    /**
     * 
     * @return
     */
    public boolean isSnack() {
        return this.equals(SNACK);
    }
	
	/**
	 * @return
	 */
	public String getAlias() {
		return alias;
	}
	
	/**
	 * @return
	 */
	public String getDescription() {
		return description;
	}
}
